
def log_message(message):
  print("=" * 20 + str(message) + "=" * 20)

def is_numeric(string):
  try:
    float(string)
    return True
  except ValueError:
    return False

def round_to_nearest_half(number):
  # 定义可能的目标值
  targets = [0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0]
  # 使用min函数和abs()来找到最接近的目标值
  closest_value = min(targets, key=lambda x: abs(x - number))
  return closest_value




